package com.api;

import okhttp3.Request;
import com.bean.Token;
import com.client.LocalHttpClient;

public class TokenAPI extends BaseAPI {

	/**
	 * 获取access_token
	 * 
	 * @param appid
	 * @param secret
	 * @return
	 */
	public static Token get(String appid, String secret) {
		Request request = new Request.Builder().url(
				BASE_URI + String.format("/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appid, secret)).build();
		return LocalHttpClient.execute(request, Token.class);
	}
}
